Working with RGB and HLS Color Coding Systems in SAS Software
نویسنده
چکیده
Full-color displays have become commonplace with the advent of the Web. Typically they are rendered from desktop computers equipped with 16-bit color palettes capable of generating 65K unique colors. Thus a chart or scale is needed for making informed color selections for graphics applications. In SAS, the programmer has access to both the RGB (red/green/blue) and HLS (hue/light/saturation) coding systems. However, different algorithms are required for building charts and scales in the two systems. Before the technical aspects of chart and scale construction are presented in the paper, color spaces are defined to show how the full gamut of codes is mapped in both coding systems. For RGB, codes map to a cube, and a double-ended cone accommodates the Tektronix HLS system. With the color spaces as a foundation, instructions are then provided for building color charts with ODS and scales from PROC GPLOT. Both the charts and scales were introduced in the SUGI 27 paper Using ODS and the Macro Facility to Construct Color Charts and Scales for SAS Software Applications. RGB: The Color System for Screen Output The RGB (red/green/blue) Color Space Originally defined for color TV, the RGB system is the only system that is Web compatible (Weinman, 86). This means RGB codes are used in GIF, JPG and HTML files. In Figure 1, the color space for this screen-based system is depicted as a cube. While there are eight vertices in the cube, all are defined by combining the primary colors: red, green, and blue. Cyan(0,1,1), for example, contains a mixture of green and blue but no red, and red with (1,0,0) contains neither green nor blue only red. The cube in Figure 1 is constructed from an application of the G3D procedure that uses an ANNOTATE data set for coloring edges and vertices. The vertices are "dots" and the edges are marker font "U's" expressed as small parallelograms connected to form a "line" of color. Only one parameter is altered to traverse the cube. To go from red(1,0,0) to yellow(1,1,0), for example, green is added in incremental amounts along the base line. There is also a one-to-one correspondence between the X-Y-Z coordinates(0-1) and the RGB code values(0-255). Since SAS uses hexadecimal notation, yellow plotted at (1,1,0) translates to (255,255,0) or CXFFFF00 for actual coloring. The faces of the cube can be represented in 2-D space with an application of the GPLOT procedure. In Figure 2, one color coordinate is held constant and the other two are varied systematically to color all six sides of the RGB cube. Look at the top face in Figure 1. It corresponds to the second face rotated 90° in row 3 of Figure 2. Note that the value for the blue or third component at all four vertices is set to 1. The title "Blue=1" in Figure 2 should now make sense. To plot the diagonals in the RGB cube, all three components need to be systematically varied between two opposing vertices. The gray "line" connecting the black (0,0,0) and white (1,1,1) vertices in Figure 3 is created with an application of the LINES macro below: %macro Lines(SR,SG,SB,TR,TG,TB,n,ds); data &ds; length function font value color $8 text $12; retain function 'label' text 'U' style 'marker'; retain xsys ysys zsys '2'; %do i=0 %to %eval(&n-1); %let r=%sysevalf(&sr+(&tr.&sr.)*&i/&n.); Figure 1. RGB color space depicted as a cube. Coordinate ranges 0-1 directly map to color ranges 0-255.
منابع مشابه
Morphological coding of color images by vector connected filters
This paper deals with the use of the vector levelings for coding color images, a class of morphological connected filters which suppresses details but preserves the contours of the remaining objects. If the color images are filtered by independently leveling each color component, new colors may be introduced. In order to avoid this drawback, a total order must be imposed on the color vectors. A...
متن کاملColor Space with RGB Reversibility and Low Dynamic Range
At the Geneva meeting we presented the YCoCg color space [1], including its simple transformation equations relative to RGB and its improved coding gain relative to both RGB and YCbCr. We also discussed the reversibility of RGB to YCoCg conversion process in the case that two additional bits of precision are used for YCoCg relative to the precision used for source RGB data. In this proposal, we...
متن کاملMultispectral image compression for spectral and color reproduction based on lossy to lossless coding
In this paper we propose a multispectral image compression based on lossy to lossless coding, suitable for both spectral and color reproduction. The proposed method divides a multispectral image data into two groups, RGB and residual. The RGB component is extracted from the multispectral image, for example, by using the XYZ Color Matching Functions, a color conversion matrix, and a gamma curve....
متن کاملFractal color image compression using vector distortion measure
In this paper, fractal monochrome image compression technique proposed by Jacquin is investigated for 24-bit true color image by encoding the RGB components' images independently. To exploit the spectral redundancy in RGB components, the root mean square error distortion measure in grayscale space is extended to 3-dimensional color space for fractal-based color image coding. Experimental result...
متن کاملRGB video coding using the matched neighbourhood block in the inter-color plane
H.264/AVC High 4:4:4 Intra/Predictive profiles supports RGB 4:4:4 sequences for high fidelity video. RGB color planes rather than YCbCr color planes are preferred by high-fidelity video applications such as digital cinema, medical imaging, and UHDTV. Several RGB coding tools have therefore been developed to improve the coding efficiency of RGB video. In this paper, we propose a new method to ex...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2002